<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTaskBooksTable extends Migration
{
    public function up()
    {
        Schema::create('task_books', function (Blueprint $table) {
            $table->id();
            $table->foreignId('selection_id')->constrained('topic_selections')->onDelete('cascade');
            $table->text('specific_tasks');
            $table->text('schedule_requirements');
            $table->timestamp('published_at')->nullable();
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('task_books');
    }
} 